package com.gusha.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity
@Table(name="sys_ground")
@NamedQuery(name="SysGround.findAll", query="SELECT s FROM SysGround s")
@DynamicInsert
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SysGround implements Serializable{
private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	private BigInteger id;
	
	/**  */
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="user_id")
    private User userId;
	
    /** 土地面积 */
	@Column(name="gr_acreage")
    private BigDecimal grAcreage;
	
    /** 租地期限 */
	@Column(name="gr_term")
    private BigDecimal grTerm;
	
    /**土地地址  */
	@Column(name="gr_address")
    private String grAddress;
	
    /**土地单价  */
	@Column(name="gr_price")
    private BigDecimal grPrice;
	
    /**支付时间  */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="payment_time")
    private Date paymentTime;
	
    /** 0未购买1已购买 */
	@Column(name="payment_state")
    private BigInteger paymentState;
	
	//用户信息
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name="address_id")
	private ReceivingAddress address;
	
	@Column(name="ground_type")
	private BigInteger groundType;//1蔬菜土地  2水产土地  3家禽土地  4水果土地  5花卉土地

	public BigInteger getGroundType() {
		return groundType;
	}

	public void setGroundType(BigInteger groundType) {
		this.groundType = groundType;
	}

	public ReceivingAddress getAddress() {
		return address;
	}

	public void setAddress(ReceivingAddress address) {
		this.address = address;
	}

	public BigInteger getId() {
		return id;
	}

	public void setId(BigInteger id) {
		this.id = id;
	}

	public User getUserId() {
		return userId;
	}

	public void setUserId(User userId) {
		this.userId = userId;
	}

	public BigDecimal getGrAcreage() {
		return grAcreage;
	}

	public void setGrAcreage(BigDecimal grAcreage) {
		this.grAcreage = grAcreage;
	}

	public BigDecimal getGrTerm() {
		return grTerm;
	}

	public void setGrTerm(BigDecimal grTerm) {
		this.grTerm = grTerm;
	}

	public String getGrAddress() {
		return grAddress;
	}

	public void setGrAddress(String grAddress) {
		this.grAddress = grAddress;
	}

	public BigDecimal getGrPrice() {
		return grPrice;
	}

	public void setGrPrice(BigDecimal grPrice) {
		this.grPrice = grPrice;
	}

	public Date getPaymentTime() {
		return paymentTime;
	}

	public void setPaymentTime(Date paymentTime) {
		this.paymentTime = paymentTime;
	}

	public BigInteger getPaymentState() {
		return paymentState;
	}

	public void setPaymentState(BigInteger paymentState) {
		this.paymentState = paymentState;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
}
